﻿function pageLoad(sender, args)
{

     $addHandler($get("ChangPwdButton"),"click",SavePwd);
}
//保存我的密码
function SavePwd()
{
$get("SPwdAgain").style.display='none';
$get("SPassword").style.display='none';
showProgressBar(true);
var vlid=true;
if($get("Password").value.length<6)
 {
    vlid=false;
    $get("SPassword").style.display='';
 }
 if($get("PwdAgain").value.length<6)
 {
    vlid=false;
    $get("SPwdAgain").style.display='';
     $get("SPwdAgain").innerHTML=SPwdAgain2;
 }else if($get("PwdAgain").value!=$get("Password").value)
 {
  vlid=false;
  $get("SPwdAgain").style.display='';
    $get("SPwdAgain").innerHTML=SPwdAgain1;
 }
if(!vlid){
showProgressBar(false);
 return;}
   
$get("ChangPwdButton").disabled=true;
var pwd=$get("Password").value;
WebServices.My.UpdateMyPwd( memberno, pwd,onsucc); 
}
//通过判断来激活保存按钮

function onsucc(result)
 {
     

     if(result)
     { 
             top.location = "/user/login.htm";
        return;
       }
       else
       {
        $get("MessagesBox").style.display='';
        $get("MessageImg").src = MessageImageF;
        $get("MessageText").innerHTML = MessageTextF;
        $get("btnSave").disabled=false;
       document.getElementById('PwdAgain').value="";
            document.getElementById('Password').value="";
       }

    
   
  $get("ChangPwdButton").disabled=false;
             showProgressBar(false);
   
 }
